﻿namespace DimensionsHelper.LanguageService.Protocol;

/// <summary>
///     A document highlight kind.
/// </summary>
public enum DocumentHighlightKind
{
    /// <summary>
    ///     A textual occurrence.
    /// </summary>
    Text = 1,

    /// <summary>
    ///     Read-access of a symbol, like reading a variable.
    /// </summary>
    Read = 2,

    /// <summary>
    ///     Write-access of a symbol, like writing to a variable.
    /// </summary>
    Write = 3
}


/// <summary>
///     A document highlight is a range inside a text document which deserves
///     special attention.Usually a document highlight is visualized by changing
///     the background color of its range.
/// </summary>
public class DocumentHighlight
{
    private DocumentHighlight(Range range, DocumentHighlightKind? kind)
    {
        Range = range;
        Kind = kind;
    }

    /// <summary>
    ///     The range this highlight applies to.
    /// </summary>
    public Range Range { get; }


    /// <summary>
    ///     The highlight kind, default is [text](#DocumentHighlightKind.Text).
    /// </summary>
    public DocumentHighlightKind? Kind { get; }


    /// <summary>
    ///     Create a DocumentHighlight object.
    /// </summary>
    /// <param name="range">The range the highlight applies to.</param>
    /// <param name="kind">The highlight kind</param>
    public static DocumentHighlight Create(Range range, DocumentHighlightKind? kind)
    {
        return new DocumentHighlight(range, kind);
    }
}